﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sgr.OmniMetrics
{
    public static class OmniMetricExtensions
    {
        /// <summary>
        /// 创建指标的简单工厂方法
        /// </summary>
        public static OmniMetric<T> Create<T>(string key, double basicValue, T? extendedValues = null)
            where T : class
        {
            var metric = new OmniMetric<T>
            {
                MetricKey = key,
                BasicValue01 = basicValue,
                ExtendedValues = extendedValues
            };
            metric.AlignTimeValue();
            return metric;
        }
    }
}